"""drfdemo URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from rest_framework.permissions import IsAuthenticated
from django.contrib import admin
from django.urls import path, include
from rest_framework.documentation import include_docs_urls

# yasg的视图配置类，用于生成api
# from drf_yasg.views import get_schema_view
# from drf_yasg import openapi
#
# schema_view = get_schema_view(
#     openapi.Info(
#         title="drf接口文档",  # 必传
#         default_version="v1.0.0",  # 必传
#         description="描述信息",
#         terms_of_service="",
#         contact=openapi.Contact(email="xiaodeng@qq.com"),
#         license=openapi.License(name="协议版本")
#     ),
#     public=True,  # 允许所有人访问
#     # permission_classes=(IsAuthenticated,)  # 权限类
# )

urlpatterns = [
    # path("doc/", schema_view.with_ui("swagger", cache_timeout=0, name="schema-swagger")),
    path("docs/", include_docs_urls(title="接口文档")),
    path('admin/', admin.site.urls),
    path("api/", include("stuapi.urls", namespace="api")),
    path("api/", include("students.urls", namespace="students_api")),
    path("sers/", include("sers.urls", namespace="sers")),
    path("req/", include("req.urls", namespace="req")),
    path("demo/", include("demo.urls", namespace="demo")),
    path("school/", include("school.urls", namespace="school")),
    path("homework/", include("homework.urls", namespace="homework")),
    path("opt/", include("opt.urls", namespace="opt")),
    path("demo/", include("demo_review.urls", namespace="demo"))

]
